<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html lang="zh-CN">
<head>
<meta charset="UTF-8">
<title>德通物流|托运单</title>
<link href="${pageContext.request.contextPath}/css/bootstrap.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/style.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/bootstrap-datetimepicker.min.css" rel="stylesheet">
<link href="${pageContext.request.contextPath}/css/bootstrapValidator.min.css" rel="stylesheet">
</head>
<body>
	<div class="container">
		<%@ include file="../navigation.jsp"%>

		<div class="main">
			<h2 style="text-align: center">托运单列表</h2>
			<form action="${pageContext.request.contextPath}/admin/cbill" method="get" style="margin: 20px 0" id="headForm">
				<label style="margin-left: 0">时间:&nbsp;&nbsp;</label> 
				<span class='input-group date' style="display: inline;"> 
				<span class="input-group-addon" style="display: inline;"> 
				<span class="glyphicon glyphicon-calendar"></span></span> 
				<input type='text' class='txt' class="form-control" name="lower" style="display: inline;width:120px;padding-left:10px" 
					 <c:if test="${queryDto.lower != 0}">value="${queryDto.lowerStr}"</c:if>/>
				</span> <span>&nbsp;—&nbsp;</span> 
				<span class='input-group date' style="display: inline;"> 
				<span class="input-group-addon" style="display: inline;"> 
				<span class="glyphicon glyphicon-calendar"></span></span> 
				<input type='text' class='txt' class="form-control" name="supper"  style="width:120px;padding-left:10px"
					<c:if test="${queryDto.supper != 0}">value="${queryDto.supperStr}"</c:if>/>
				</span> <label>&nbsp;&nbsp;出发站点:&nbsp;&nbsp;</label><select name="start">
					<option></option>
					<c:forEach items="${station_list}" var="station">
						<option value="${station}" <c:if test="${queryDto.start ==  station}"> selected="selected"</c:if>>${station}</option>
					</c:forEach>
				</select> <label>&nbsp;&nbsp;目的站点:&nbsp;&nbsp;</label><select name="end">
					<option></option>
					<c:forEach items="${station_list}" var="station">
						<option value="${station}" <c:if test="${queryDto.end ==  station}"> selected="selected"</c:if>>${station}</option>
					</c:forEach>
				</select> <label>&nbsp;&nbsp;托运状态:&nbsp;&nbsp;</label><select name="status">
					<option value="0"></option>
					<option value="1" <c:if test="${queryDto.status == 1}"> selected="selected"</c:if>>待发货</option>
					<option value="2" <c:if test="${queryDto.status == 2}"> selected="selected"</c:if>>已发货</option>
					<option value="3" <c:if test="${queryDto.status == 3}"> selected="selected"</c:if>>待通知</option>
					<option value="4" <c:if test="${queryDto.status == 4}"> selected="selected"</c:if>>待领取</option>
					<option value="5" <c:if test="${queryDto.status == 5}"> selected="selected"</c:if>>已完成</option>
				</select>
				<button type="submit" class="btn btn-primary" style="margin: 0 30px">查询</button>
				<label>&nbsp;&nbsp;运费总和:&nbsp;&nbsp;</label><label style="color:#F00">&nbsp;&nbsp;${sum}&nbsp;&nbsp;元</label>
			</form>
			<table class="table table-striped table-bordered">
				<thead>
					<tr>
						<th>货票号</th>
						<th>日期</th>
						<th>发货人</th>
						<th>发货站点</th>
						<th>收货人</th>
						<th>收货站点</th>
						<th>货物</th>
						<th>运费</th>
						<th>状态</th>
						<th>详情</th>
					</tr>
				</thead>
				<tbody>
				<c:forEach items="${cbill_list}" var="cbill">
					<tr>
						<td>${cbill.invoiceNo}</td>
						<td>${cbill.dateStr}</td>
						<td>${cbill.consignor}</td>
						<td>${cbill.deliveryStation}</td>
						<td>${cbill.consignee}</td>
						<td>${cbill.reveivingStation}</td>
						<td>${cbill.goods}</td>
						<td>${cbill.freight}</td>
						<td><c:choose>
							<c:when test="${cbill.status == 1}">待发货</c:when>
							<c:when test="${cbill.status == 2}">已发货</c:when>
							<c:when test="${cbill.status == 3}">待通知</c:when>
							<c:when test="${cbill.status == 4 }">待领取</c:when>
							<c:when test="${cbill.status == 5}">已完成</c:when>
						</c:choose></td>
						<td><a href="${pageContext.request.contextPath}/admin/cbill/record?invoiceNo=${cbill.invoiceNo}">详情</a></td>
					</tr>
				</c:forEach>
				</tbody>
			</table>
		</div>
	</div>

	<script src="${pageContext.request.contextPath}/js/jquery.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/moment-with-locales.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap-datetimepicker.min.js"></script>
	<script src="${pageContext.request.contextPath}/js/bootstrap-datetimepicker.zh-CN.js"></script>
	<script type="text/javascript">
		$(document).ready(function() {
			$("#index").removeClass("active");
			$("#logical").removeClass("active");
			$("#query").addClass("active");
			$("#system").removeClass("active");
			
			$(".date").datetimepicker({
				format : "yyyy-mm-dd",
				language : "zh-CN",
				autoclose : true,
				minView : "month"
			});
		});
		
	</script>

</body>
</html>